<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function reverseStr(str){
            var arr = str.split(" ");
            console.log(arr)
            arr.reverse();
            return console.log(arr.join(" "))
        }
        var str1 = reverseStr("Welcome to Beijing")
        console.log("===========================================================")

        function reverseconcat(arr){
            var str1 = arr.concat()
            str1 = str1.reverse()
            arr = arr.concat(str1)
            return arr
        }
        var str1 = ["One","Two","Three"]
        console.log(reverseconcat(str1))
        console.log("===========================================================")

        var str1 = countOfWord("Yes,she*is%my@love.")
        console.log(str1)
        function countOfWord(arr){
            var str2 = arr
            var count=0
            for( var i = 0; i < str2.length - 1 ; i++)
            {
                
                if(checkChar(str2[i])&&!checkChar(str2[i+1])){
                    count++
                }
                
            }
            return count
        }
        function checkChar(n){
            if(n>="a"&&n<="z"||n>="A"&&n<"Z")
            {
                return true
            }else{
                return false
            }
        }

        console.log("===========================================================")



        alert(countOfStr("abcabcabc","ab"))
        function countOfStr(supstr,substr){
            var arr = supstr.split(substr)
            console.log(arr)
        }

    </script>
</head>
<body>
    
</body>
</html>